package co.fitstart.coach.service.impl;


import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.annotation.Dynamic;
import com.demo2do.core.service.impl.GenericServiceImpl;

import co.fitstart.coach.dao.CoachDao;
import co.fitstart.coach.dao.PrincipalDao;
import co.fitstart.coach.service.PrincipalService;
import co.fitstart.entity.principal.Principal;
import co.fitstart.entity.site.Site;

/**
 * 
 * @author downpour
 */
@Service("principalService")
public class PrincipalServiceImpl extends GenericServiceImpl<Principal> implements PrincipalService{
    
    @Dynamic
    private PrincipalDao principalDao;
    
    @Dynamic
    private CoachDao coachDao;
    
    /*
     * (non-Javadoc)
     * @see co.fitstart.coach.service.PrincipalService#getPrincipal(java.lang.String)
     */
    public Principal getPrincipal(String mobile) {
        return principalDao.get(mobile);
    }
    
    /*
     * (non-Javadoc)
     * @see co.fitstart.coach.service.PrincipalService#decideSite(co.fitstart.entity.principal.Principal)
     */
    public Site decideSite(Principal principal) {
    	return coachDao.decideSite(principal);
    }

}
